﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DispatchAssist.BusinessLogical.Model;
using DispatchAssist.Model;

namespace DispatchAssist.BusinessLogical.DAL
{
    public interface IDataProvider
    {

        #region AlertMsg 吴中奇

        List<MeteoMsg> GetUnCreateMeteoMsgList(int status, int exceptStatus);

        List<AlertRule> GetAlertRuleByPara(string airPort, int level);

        List<FlightInfo> GetFligetInfoByMtMsg(string airPort, DateTime effecTime);

        Alert CreateAlert(Alert alert);

        void UpdateMeteoStatus(List<string> Ids, Enums.MeteoMsgStatus status);

        List<SeatMonitor> GetSeatMonitorByPara(string TailNo, string SeatID);

        List<EarlyWarning> GetEarlyTimeByPara(string airPort);

        List<AlertAllInfo> GetNecessaryAlertInfo(Guid alertID, int selectFlag, int updateFlag);

        List<MsgTemplate> GetMsgTemplate(string ID, int AlertAction, string TargetType);

        List<ACARSDevice> GetDeviceModel(string tailNo);

        ACARSMsg InsertACARSMsgModel(ACARSMsg model);

        void UpdateAlertStatus(string[] ids, int status);

        List<AlertAllInfo> GetRecentClientAlertInfo();

        void InsertSMSAlertModel(SMSAlert model);

        List<FlightInfo> GetSMSFlightInfoByMtMsg(string airport, DateTime startTime, DateTime endTime);

        List<SMSAlertAllInfo> GetNecessarySMSAlert(Guid alertID, Enums.AlertActionFlag selectFlag, Enums.AlertActionFlag performFlag);

        void InertSMSMessageModel(SMSMsg model);

        void UpdateSMSAlertStatus(string[] IDs, Enums.AlertActionFlag performAction);

        List<SMSContact> GetContactList(string companyCode);

        List<SMSAlertAllInfo> GetRecentClientSMSAlertInfo();

        void WriteActionLog(List<ActionPerformLog> logList);

        List<SMSMsg> GetSendSMSMessageList();

        void UpdateSMSMsgStatus(string[] IDs, int Status);

        List<ACARSMsg> GetSendAcarsMsgList();

        void UpdateAcarsMsgStatus(string[] IDs, int Status);

        List<AlertAllInfo> GetAlertInfoByIDs(Guid[] ids);

        List<AlertAllInfo> GetAlertHisInfoByIDs(Guid[] ids);


        List<MeteoMsg> GetMeteoListByAirportAndLevel(string airport, DateTime effectiveTime, int warnLevel, Guid msgid);

        List<SeatLogin> GetAllLoginUser(bool? status);

        List<SeatTails> GetAllSeatTails();

        List<PlaneType> GetAllPlaneType();

        string SaveSeatTails(Guid SeatID, string[] Tails);

        string InsertPlaneType(PlaneType model);

        string UpdatePlaneType(PlaneType model);

        string InsertPlaneInfo(ACARSDevice model);

        string UpdatePlaneInfo(ACARSDevice model);

        bool DeletePlaneType(int TypeID, string ParentOrChild);

        bool DeletePlaneInfo(string tailNo);

        bool SeatUserIsLogin(Guid SeatID, string UserID);

        List<SeatRelation> GetSeatRelation();

        List<Seat> GetDelegatableSeats(Guid SeatID);

        string InsertDelegateRelation(SeatRelation Model);

        void UpdateDelegateStatus(Guid RelationID, int Status);

        #endregion
        #region MeteoMsg 王劲松
        Dictionary<string, DateTime> GetRecentFileNames(int recentDays);
        MeteoMsg CreateMeteoMsg(MeteoMsg meteoMsg);

        List<AlertRule> GetAllAlertRuleRecords();
        bool CreateAlertRule(AlertRule alertRule);
        bool UpdateAlertRule(AlertRule alertRule);
        bool DeleteAlertRule(Guid alertRuleID);
        List<MsgTemplate> GetAllMsgTemplateRecords();
        bool CreateMsgTemplate(MsgTemplate msgTemplate);
        bool UpdateMsgTemplate(MsgTemplate msgTemplate);
        bool DeleteMsgTemplate(Guid msgTemplateID);

        List<EarlyWarning> GetAllEarlyWarningRecords();
        bool CreateEarlyWarning(EarlyWarning earlyWarning);
        bool UpdateEarlyWarning(EarlyWarning earlyWarning);
        bool DeleteEarlyWarning(Guid earlyWarningID);


        List<AlertActionDefine> GetAllAlertActionDefineRecords();

        bool UpdateFlightBackUpInfo(FlightInfo flightInfo);
        List<FlightInfo> GetFlightInfoByPara(string carrier, string flightNo, DateTime planDeptTime, string deptAirport, int flag);

        List<MeteoMsg> GetMeteoMsgListByPara(int relationType, string airPort, DateTime? effectTime);


        void InsertSystemLog(List<SystemLog> logList);
        object QueryLogCommon(string logTypeStr, List<QueryCondition> qc);
        List<NormalAlertInfo> GetAllAlertInfo();

        List<SMSAlertAllInfo> GetAllSMSAlertInfo();

        List<NormalAlertInfo> GetNormalAlertInfoByIDs(Guid[] ids);
        List<SMSAlertAllInfo> GetSMSAlertInfoByIDs(Guid[] ids);
        #endregion
        #region FlightInfo 张希贵

        #endregion

        #region SeatManage 张希贵
        Model.Enums.DataAccessReturnValue ChangePassword(SeatUser seatUser, byte[] oldPassword);
        bool CreateSeatUser(SeatUser seatUser);
        bool UpdateSeatUser(SeatUser seatUser);
        bool DeleteSeatUser(Guid userID, bool deleteFlag);
        List<SeatUser> GetAllSeatUser(int flag);
        List<SeatRole> GetAllSeatRole();
        bool CreateSeatRole(SeatRole seatRole);
        bool UpdateSeatRole(SeatRole seatRole);
        bool DeleteSeatRole(Guid roleID);
        List<SystemModule> GetSystemModules();

        SeatUser Login(string userName, byte[] password, Guid seatId);
        bool Logout(Guid userId, Guid seatId);
        bool CreateSeat(Seat seat);
        bool DeleteSeat(Seat seat);
        bool UpdateSeat(Seat seat);
        DispatchAssist.BusinessLogical.Model.Enums.DataAccessReturnValue CreateSeatMonitor(SeatMonitor seatMonitor);
        bool DeleteSeatMonitor(Guid seatMonitorID);
        List<SeatMonitor> GetSeatMonitors();
        List<SMSContactGroup> GetContactGroup();
        Enums.DataAccessReturnValue CreateSMSContactGroup(SMSContactGroup group);
        Enums.DataAccessReturnValue UpdateSMSContactGroup(SMSContactGroup group);
        bool DeleteSMSContactGroup(Guid groupID);
        List<SMSContact> GetAllSMSContacts();
        bool CreateSMSContact(SMSContact contact);
        bool DeleteSMSContact(Guid contactID);
        bool UpdateSMSContact(SMSContact contact);
        #endregion

        #region Common

        List<InfoAirport> LoadInfoAirportList();

        List<T> GetModelList<T>(string procedure);

        string GetTablePKColumn(string tableName);

        #endregion

    }
}
